package io.cici.cc.mybatis.lite.mapping;

import io.cici.cc.mybatis.lite.session.Configuration;
import io.cici.cc.mybatis.lite.type.TypeHandler;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Setter
@Getter
public class ParameterMapping {

    private Configuration configuration;

    private String property;
    private Class<?> parameterType;
    private String type;
    private TypeHandler<?> typeHandler;


    private ParameterMapping() {
    }


    public static class Builder {
        private final ParameterMapping parameterMapping = new ParameterMapping();

        public Builder(Configuration configuration, String property, Class<?> parameterType, String type, TypeHandler<?> typeHandler) {
            parameterMapping.configuration = configuration;
            parameterMapping.property = property;
            parameterMapping.parameterType = parameterType;
            parameterMapping.type = type;
            parameterMapping.typeHandler = typeHandler;

        }


        public ParameterMapping build() {

            return parameterMapping;
        }
    }
}
